//
//  ZZHomeViewController.m
//  Sina
//
//  Created by 张卓 on 2017/1/16.
//  Copyright © 2017年 ZZ. All rights reserved.
//

#import "ZZHomeViewController.h"
#import "UIButton+ZZBnt.h"

@interface ZZHomeViewController ()

@end

@implementation ZZHomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setupUI];
}

- (void)setupUI {
    
    [self setupNav];
}
- (void)setupNav {
    //navigationbar_friendsearch_highlighted
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:[UIButton leftBntWith:@"navigationbar_friendsearch" andTitle:nil andTarget:self andAction:@selector(leftBntClick)]];
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:[UIButton leftBntWith:@"navigationbar_pop" andTitle:nil andTarget:self andAction:@selector(rightBntClick)]];
    
    
    
}

//- (UIButton*)leftBntWith:(NSString*)imageName andTitle:(NSString*)title andTarget:(id)target andAction:(SEL)action {
//    UIButton *bnt = [[UIButton alloc]init];
//    if(imageName != nil){
//        [bnt setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
//        [bnt setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@_highlighted",imageName]] forState:UIControlStateHighlighted];
//    }
//    if(title != nil){
//        [bnt setTitle:title forState:UIControlStateNormal];
//        [bnt setTitle:title forState:UIControlStateHighlighted];
//    }
//    [bnt sizeToFit];
//    
//    return bnt;
//}

- (void)leftBntClick {
    NSLog(@"点击左边按钮");
}
- (void)rightBntClick {
    
    NSLog(@"点击右侧按钮");
    ZZNextViewController *nextVC = [[ZZNextViewController alloc]init];
    [self.navigationController pushViewController:nextVC animated:YES];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
